package com.wimcorp.magic.board;

import java.rmi.RemoteException;

import com.wimcorp.magic.cards.Creature;
import com.wimcorp.magic.cards.PlayingCard;
import com.wimcorp.magic.phase.Turn;
import com.wimcorp.magic.players.Player;

public class Graveyard extends Cards {

	public Graveyard(Player player) {
		super(player);
	}

	public void add(PlayingCard card) {
		super.add(card);
		if (card instanceof Creature) {
			Turn.setMorbid(true);
		}
	}

	@Override
	protected void messagePlayersCardAdded(PlayingCard card) {
		try {
			getPlayer().getUserInterface().message(String.format("Card %s was added to graveyard. ", card.getName()));
			getPlayer().getOpponent().getUserInterface()
					.message(String.format("Opponent's Card %s was added to graveyard. ", card.getName()));
		} catch (RemoteException e) {
			e.printStackTrace();
		}

	}

}
